import * as actionTypes from '../actions/actionTypes'
function countReducer(previousState={
    count:10
},action){
    switch(action.type){
        case actionTypes.INCREMENT:
            return {
                ...previousState,
                count:previousState.count+action.num
            }
        case actionTypes.SUBTRACTION:
            return{
                ...previousState,
                count:previousState.count-action.num
            }
        default:
            return previousState
    }
}
export default countReducer